/*
 * @Author: 小羊今晚不睡觉 2226764294@qq.com
 * @Date: 2025-09-25 13:17:41
 * @LastEditors: 小羊今晚不睡觉 2226764294@qq.com
 * @LastEditTime: 2025-10-09 15:34:20
 * @FilePath: \yougongxia-backstage\src\api\dashboard\console.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Alova } from '@/utils/http/alova/index';
import { http } from '@/utils/http/axios';
import { RequestEnum } from '@/enums/httpEnum';

export interface TypeVisits {
  dayVisits: number;
  rise: number;
  decline: number;
  amount: number;
}
export interface TypeSaleroom {
  weekSaleroom: number;
  amount: number;
  degree: number;
}

export interface TypeOrderLarge {
  weekLarge: number;
  rise: number;
  decline: number;
  amount: number;
}

export interface TypeConsole {
  visits: TypeVisits;
  //销售额
  saleroom: TypeSaleroom;
  //订单量
  orderLarge: TypeOrderLarge;
  //成交额度
  volume: TypeOrderLarge;
}

//获取主控台信息
export function getConsoleInfo() {
  return Alova.Get<TypeConsole>('/dashboard/console');
}

/**
 * @description: 统计数据（百分比）
 */
export function getCount() {
  return http.request({
    url: '/v1/admin/stats/count',
    method: RequestEnum.GET,
  });
}

/**
 * @description: 统计数据（图标）
 */
export function getChart() {
  return http.request({
    url: '/v1/admin/stats/chart',
    method: RequestEnum.GET,
  });
}
